<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-channelWallet-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">余额：</label>
				<div class="col-sm-8">
					<input id="accountBalance" name="accountBalance" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">冻结金额：</label>
				<div class="col-sm-8">
					<input id="frozenBalance" name="frozenBalance" class="form-control" type="text" required>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "channel/wallet";



        $.validator.addMethod("regex",function (value, element, params) {
            var exp = new RegExp(params);
            return exp.test(value);
        },"请输入数字(可保留两位小数)");
        /*规则校验*/
		$("#form-channelWallet-add").validate({
			rules:{
                accountBalance:{
                    regex:"^[0-9]+(.[0-9]{2}|.[0-9]{1})?$"
                },
                frozenBalance:{
                    regex:"^[0-9]+(.[0-9]{2}|.[0-9]{1})?$"
                }
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-channelWallet-add').serialize());
	        }
	    }
	</script>
</body>
</html>
